﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_SiteMasterPage/Site.Master" AutoEventWireup="true" CodeBehind="CompanyManagementAddNew.aspx.cs" Inherits="eProject.Web.UI.Admin.CompanyManagementAddNew" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="script" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="LeftContent" runat="server">
<div id="widget-categories" class="widget widget-categories">
        <div class="widget-inner">
            <div class="widget-title">
                <h5>
                    Company</h5>
            </div>
            <div class="widget-content">
                <ul>
                    <li><a class="add" href="CompanyManagementAddNew.aspx">Add New</a></li>
                    <li><a href="CompanyManagementProgram.aspx">List Company</a></li>
                </ul>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightContent" runat="server">
<div class="widget">
<div class="widget-inner">
<div class="widget-title">
        <h5>
            Company Add New
        </h5>
    </div>
    <div class="widget-content">
        <!--[if lt IE 9]><div class="ie"><![endif]-->
        <asp:ValidationSummary ID="vsSumary" ValidationGroup="Insert" runat="server"  CssClass="frmValidation"/>
        <div class="frm">
            <fieldset>
                <dl>
                    <dt>
                        <label>
                            Company Name:</label><br />
                        <span>Please insert name of Company</span> </dt>
                    <dd>
                        <asp:TextBox ID="txtCompanyName" runat="server" Width="190px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtCompanyName" ControlToValidate="txtCompanyName" runat="server" ErrorMessage="Company name is empty" ValidationGroup="Insert" Text="*"></asp:RequiredFieldValidator>
                    </dd>
                </dl>
                <dl>
                    <dt>
                        <label>
                            Company Address:</label><br />
                        <span>Please insert address of Company</span> </dt>
                    <dd>
                        <asp:TextBox ID="txtAddressCompany" runat="server" Width="190px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvtxtAddressCompany" ControlToValidate="txtAddressCompany" runat="server" ErrorMessage="Company Address is empty" ValidationGroup="Insert" Text="*"></asp:RequiredFieldValidator>
                    </dd>
                </dl>
                <dl>
                    <dt>
                        <label>
                            Company Phone:</label><br />
                        <span>Please insert phone number of Company</span> </dt>
                    <dd>
                        <asp:TextBox ID="txtPhoneNumber" runat="server" Width="190px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvPhoneNumber" runat="server" ControlToValidate="txtPhoneNumber"
                                    ValidationGroup="Register" Display="Dynamic" CssClass="txtError" Text="*" ErrorMessage="Enter Phone number." />
                    </dd>
                </dl>
                <dl>
                    <dt>
                        <label>
                            Company Email:</label><br />
                        <span>Please insert email of Company</span> </dt>
                    <dd>
                        <asp:TextBox ID="txtEmail" runat="server" Width="190px"></asp:TextBox>
                        <%--<asp:RequiredFieldValidator ID="rfvtxtEmail" ControlToValidate="txtEmail" runat="server" ErrorMessage="Email is empty" ValidationGroup="Insert"  Text="*" ClientIDMode></asp:RequiredFieldValidator>--%>
                        <asp:CustomValidator ID="cusEmail" runat="server" ValidationGroup="Insert" Display="Dynamic"
                                    CssClass="txtError" ClientValidationFunction="cusEmail_ClientValidate" Text="*" />
                    </dd>
                </dl>
                <dl>
                    <dt>
                        <label>
                            Company Description:</label><br />
                        <span>Please insert Description of Company</span> </dt>
                    <dd>
                        <asp:TextBox ID="txtDescription" runat="server" Width="190px" Height="77px" 
                            TextMode="MultiLine"></asp:TextBox>
                    </dd>
                </dl>
            </fieldset>
            <fieldset class="div-button">
                <div>
                    <input class="btn button1" name="btn_submit" value="Save" type="submit" runat="server" id="btnSubmit" validationgroup="Insert"/>
                    <input class="btn button2" name="btn_cancel" value="Reset" type="reset" runat="server" id="btnReset"/>
                </div>
            </fieldset>
        </div>
        <!--[if lt IE 9]></div><![endif]-->
    </div>
    </div>
    </div>
    <script type="text/javascript">
        function cusEmail_ClientValidate(sender, args) {
            var email = $('#<%=txtEmail.ClientID%>');
            if (email.val().length == 0) {
                sender.errormessage = "Enter email.";
                args.IsValid = false;
            }
            else
            if (email.val().length > 0) {
                var filter = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
                if (filter.test(email.val())) {
                    args.IsValid = true;
                }
                else {
                    sender.errormessage = "Enter valid email.";
                    args.IsValid = false;
                }
            }
        }

        $(function () {
            $("#<%=txtPhoneNumber.ClientID %>").mask("(999) 9999-9999");
        });
    </script>
</asp:Content>
